#pragma once

#include <QtCore/QtGlobal>
#include <QObject>
#include <QSet>
#include "piocore.h"

class MediaItem;

class FilterBank : public QObject
{
    Q_OBJECT
public:
    explicit FilterBank(PioCore & core, QObject *parent = 0);
    bool pass(MediaItemPtr item);
    void setExcludedCollections(const QSet<QString> & categories);
    QSet<QString> excludedCollections();
    QSet<MediaItemPtr> view();

signals:
    void added(MediaItemPtr item);
    void removed(MediaItemPtr item);
    void updated(MediaItemPtr item);

public slots:
    void onAdded(MediaItemPtr item);
    void onRemoved(MediaItemPtr item);
    void onUpdated(MediaItemPtr item);
    void setRawType(PioCore::RawType type);

private:
    void update();

    PioCore & m_core;
    QSet<QString> m_excludedCollections;
    PioCore::RawType m_type;
    QSet<MediaItemPtr> m_in, m_out;
};
